package com.sxt.sys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.support.PagedListHolder;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.sxt.sys.domain.LoginInfor;
import com.sxt.sys.mapper.LoginInforMapper;
import com.sxt.sys.service.LoginInforService;
import com.sxt.sys.utils.DataGridView;
import com.sxt.sys.vo.LoginInforVo;
@Service
public class LoginInforServiceImpl implements LoginInforService{
	@Autowired
	private LoginInforMapper loginInforMapper;
	
	
	@Override
	public DataGridView queryAllLoginInfor(LoginInforVo LoginInforVo) {
		Page<Object> page = PageHelper.startPage(LoginInforVo.getPage(),LoginInforVo.getLimit());
		List<LoginInfor> data = loginInforMapper.queryAllLoginInfor(LoginInforVo);
		return new DataGridView(page.getTotal(),data);
	}


	@Override
	public Integer addLoginInfor(LoginInforVo loginInforVo) {
		// TODO Auto-generated method stub
		return loginInforMapper.insertSelective(loginInforVo);
	}


	@Override
	public Integer deleteLoginInfor(Integer id) {
		// TODO Auto-generated method stub
		return loginInforMapper.deleteByPrimaryKey(id);
	}

}
